﻿@{
    ViewBag.Title = "Approval";
    string id = ViewBag.id;
    string pass = ViewBag.pass;
    string passMessage = string.Empty;
    switch (pass)
    {
        case "0":
            //全部/未审批
            break;
        case "1":
            //未审批
            break;
        case "2":
            passMessage = "审批通过";
            break;
        case "3":
            passMessage = "审批拒绝";
            break;
        default:
            passMessage = "审批错误";
            break;
    }
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Cache" content="no-cache" />
    <title>绿色通道审批</title>
    <link href="~/Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" />
    <link href="~/Scripts/ligerUI/skins/ligerui-icons.css" rel="stylesheet" />
    <link href="~/Scripts/ligerUI/skins/Gray/css/all.css" rel="stylesheet" />
    <link href="~/Content/css/common.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="~/Scripts/ligerUI/js/ligerui.all.js"></script>
    <script src="~/Scripts/common.js?v=@DateTime.Now.ToString("yyyyMMdd")"></script>
</head>
<body>
    <form>
        <div style="margin:10px 5px;">
            <table style="width:100%">
                <tr>
                    <td style="text-align:right;line-height:30px;">
                        审批状态：
                    </td>
                    <td style="line-height:30px;">
                        <span>@passMessage</span>
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;line-height:30px;">
                        审批备注：
                    </td>
                    <td style="line-height:30px;">
                        <textarea id="txtApprovalRemark" name="txtApprovalRemark" class="l-text" rows="10" style="height:100px;width:150px;"></textarea>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="padding-top:20px; text-align:center;">
                        <input type="hidden" id="txtId" name="txtId" value="@id" />
                        <input type="hidden" id="txtpass" name="txtpass" value="@pass" />
                        <input id="btnRes" type="reset" value="重置" class="l-button" />
                        <input id="btnSave" type="button" value="保存" class="l-button" />
                    </td>
                </tr>
            </table>
        </div>
    </form>
    <script type="text/javascript">
        //保存事件
        $("#btnSave").click(function () {
            var arr = $("form").serializeArray();
            var obj = {};
            for (var i = 0; i < arr.length; i++) {
                obj[arr[i].name] = arr[i]['value']
            }
            $.post("/ChestPainCenter/GreenChannel/ApprovalSave", obj, function (data, textStatus) {
                if (textStatus == "success") {
                    var d = $.parseJSON(data);
                    if (d.Result == 1) {
                        $.ligerDialog.success("审批完成", function () {
                            parent.window.btnSearch.click();
                            frameElement.dialog.close();
                        });
                    } else if (d.Result == 0) {
                        $.ligerDialog.error(d.Body);
                    } else {
                        $.ligerDialog.error("程序错误");
                    }
                } else {
                    $.ligerDialog.error("程序错误");
                }
            })
        });
    </script>
</body>
</html>